package com.java.module.chat.domain;

import java.util.Date;

import com.java.common.lang.domain.entity.User;
import com.java.module.chat.domain.dto.NotesDTO;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.java.common.lang.annotation.Excel;
import com.java.common.lang.annotation.FileData;
import com.java.common.lang.domain.BaseEntity;

/**
 * 聊天：会话列对象 chat_session
 * 
 * @author Administrator
 * @date 2021-05-13
 */
@FileData
public class Session extends BaseEntity {

    private static final long serialVersionUID = 1L;

    /** $column.columnComment */
    private Long sessionId;

    /** 平台标志：1安卓 2苹果 3电脑 */
    @Excel(name = "平台标志：1安卓 2苹果 3电脑")
    private Integer platform;

    /** 客服对象：0售前 1售中 2售后 */
    @Excel(name = "客服对象：0售前  1售中  2售后")
    private Integer chatType;

    /** 未读消息数量 */
    @Excel(name = "未读消息数量")
    private Integer userUnreadCount;

    /** 会话类型：1单聊 2群聊 */
    @Excel(name = "会话类型：1单聊 2群聊")
    private Integer sessionType;

    /** 消息类型：1文本 2图片 */
    @Excel(name = "消息类型：1文本 2图片")
    private Integer msgType;

    /** 0用户消息 1后台消息 */
    @Excel(name = "0用户消息 1后台消息")
    private Integer userType;

    /** 消息内容 */
    @Excel(name = "消息内容")
    private String msgContent;

    /** 消息时间 */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Excel(name = "消息时间")
    private Date msgIntime;

    /** 用户id */
    @Excel(name = "用户id")
    private Long uid;

    /** 对方id */
    @Excel(name = "对方id")
    private Long otherSideUid;

    /** 删除标志（0默认 非0表示已删除） */
    private Integer delFlag;

    /** 后台删除标志 */
    private Integer adminDelFlag;

    @FileData
    private String avatar;

    private String nickname;
    
    private ChatMessage.MsgExtra msgExtra;


    private Integer type ;

    private NotesDTO notesDTO;

    private User user;


    public ChatMessage.MsgExtra getMsgExtra() {
        return msgExtra;
    }

    public void setMsgExtra(ChatMessage.MsgExtra msgExtra) {
        this.msgExtra = msgExtra;
    }

    public Integer getAdminDelFlag() {
        return adminDelFlag;
    }

    public void setAdminDelFlag(Integer adminDelFlag) {
        this.adminDelFlag = adminDelFlag;
    }

    public void setSessionId(Long sessionId) {
        this.sessionId = sessionId;
    }

    public Long getSessionId() {
        return sessionId;
    }

    public void setPlatform(Integer platform) {
        this.platform = platform;
    }

    public Integer getPlatform() {
        return platform;
    }

    public void setChatType(Integer chatType) {
        this.chatType = chatType;
    }

    public Integer getChatType() {
        return chatType;
    }

    public void setUserUnreadCount(Integer userUnreadCount) {
        this.userUnreadCount = userUnreadCount;
    }

    public Integer getUserUnreadCount() {
        return userUnreadCount;
    }

    public void setSessionType(Integer sessionType) {
        this.sessionType = sessionType;
    }

    public Integer getSessionType() {
        return sessionType;
    }

    public void setMsgType(Integer msgType) {
        this.msgType = msgType;
    }

    public Integer getMsgType() {
        return msgType;
    }

    public Integer getUserType() {
        return userType;
    }

    public void setUserType(Integer userType) {
        this.userType = userType;
    }

    public void setMsgContent(String msgContent) {
        this.msgContent = msgContent;
    }

    public String getMsgContent() {
        return msgContent;
    }

    public void setMsgIntime(Date msgIntime) {
        this.msgIntime = msgIntime;
    }

    public Date getMsgIntime() {
        return msgIntime;
    }

    public void setUid(Long uid) {
        this.uid = uid;
    }

    public Long getUid() {
        return uid;
    }

    public void setOtherSideUid(Long otherSideUid) {
        this.otherSideUid = otherSideUid;
    }

    public Long getOtherSideUid() {
        return otherSideUid;
    }

    public void setDelFlag(Integer delFlag) {
        this.delFlag = delFlag;
    }

    public Integer getDelFlag() {
        return delFlag;
    }

    public String getAvatar() {
        return avatar;
    }

    public void setAvatar(String avatar) {
        this.avatar = avatar;
    }

    public String getNickname() {
        return nickname;
    }

    public void setNickname(String nickname) {
        this.nickname = nickname;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE).append("sessionId", getSessionId())
                .append("platform", getPlatform()).append("chatType", getChatType())
                .append("userUnreadCount", getUserUnreadCount()).append("sessionType", getSessionType())
                .append("msgType", getMsgType()).append("userType", getUserType()).append("msgContent", getMsgContent())
                .append("msgIntime", getMsgIntime()).append("uid", getUid()).append("otherSideUid", getOtherSideUid())
                .append("createTime", getCreateTime()).append("updateTime", getUpdateTime())
                .append("delFlag", getDelFlag()).append("avatar", getAvatar()).append("nickname", getNickname())
                .toString();
    }

    public Integer getType() {
        return type;
    }

    public void setType(Integer type) {
        this.type = type;
    }

    public NotesDTO getNotesDTO() {
        return notesDTO;
    }

    public void setNotesDTO(NotesDTO notesDTO) {
        this.notesDTO = notesDTO;
    }

    public User getUser() {
        return user;
    }

    public void setUser(User user) {
        this.user = user;
    }
}